/*
 * CS_SOCIAL_DELETE_FRIEND.cpp
 *
 *  Created on: 2013. 6. 20.
 *      Author: the2
 */

#include "../../Command.h"
#include "../../User.h"
#include "../../Proxy.h"
#include "../../../../protocol/iFriends.h"

namespace ProjectZ { namespace NCommand {

void Command::CS_SOCIAL_DELETE_FRIEND(User * pUser, ::Network::Packet * pPacket)
{
	PREPARE_PACKET;
	DeleteFriendSyn msg;

	*pPacket >> msg.gid;

	if( msg.gid <= 0 )
	{
		::Network::Packet * pAck = ::Network::GETPACKETPOOL()->SEND_NEW();
		pAck->MsgCat("%2d", ACK_UNKNOWN_ERROR);

		pAck->MakePacket(CMD_SC_SOCIAL_DELETE_FRIEND);
		pUser->Send(pAck);
		return;
	}

	::ProjectZ::NProxy::SendFriendsServer(pUser->GetUserSeq(), msg);
}

} /*NCommand*/ } /*ProjectZ*/


